package com.sdy.dao.mysql;

import com.sdy.po.Authority;
import com.sdy.po.Company;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CompanyMapper {

    @Select("select id from s_company")
    List<Integer> selectAllId();

    @Select("select * from s_company where id = #{id}")
    @Results({
            @Result(column = "time",property = "time"),
            @Result(column = "info",property = "info")
    })
    Company selectCompanyNameById(@Param("id") Integer id);

    /**
     * 查询所有客户信息
     * @return
     */
    @Select("select id,name,img,time,info from s_company where id != 1")
    List<Company> getAll();

    /**
     * 根据id查询公司名称
     * @param id
     * @return
     */
    @Select("select name from s_company where id = #{id}")
    String getCompanyNameById(@Param("id") Integer id);

}
